package com.erlinyou.im.web.controller.base.message;
public enum ChatType {
	SINGLE(1), GROUP(2), CALLCENTER(3), CUSTOM(4),UNKNOW(0);// 客服
	private Integer code;

	ChatType(Integer code) {
		this.code = code;
	}

	public static ChatType valueOfStr(String num) {
		switch (num) {
		case "1":
			return SINGLE;
		case "2":
			return GROUP;
		case "3":
			return CALLCENTER;
		case "4":
			return CUSTOM;
		default:
			return UNKNOW;
		}
	}
	
	public static ChatType valueOf(int num) {
		switch (num) {
		case 1:
			return SINGLE;
		case 2:
			return GROUP;
		case 3:
			return CALLCENTER;
		case 4:
			return CUSTOM;
		default:
			return UNKNOW;
		}
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

}